]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
[perf] add tweener.framePrepareStart/Done events
authorOwen W. Taylor <otaylor@fishsoup.net>
Mon, 24 May 2010 13:48:41 +0000 (09:48 -0400)
committerOwen W. Taylor <otaylor@fishsoup.net>
Wed, 26 May 2010 19:37:27 +0000 (15:37 -0400)
Add events when we start preparing a frame and finish preparing
a frame. (In addition to measuring property-updating overhead, this allows
us to see the interval between finishing preparing a frame and starting
painting the frame, which is the relayout time.)

https://bugzilla.gnome.org/show_bug.cgi?id=619515

js/ui/tweener.js

index 60aaa8d1f04f331758431caedce950ebc264b79e..f2e3b53856b564df4601865c4ad52d74ce3c0e7b 100644 (file)
@@ -4,6 +4,7 @@ const Clutter = imports.gi.Clutter;
 const GLib = imports.gi.GLib;
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
+const Shell = imports.gi.Shell;
 const Signals = imports.signals;
 const Tweener = imports.tweener.tweener;
 
@@ -221,6 +222,14 @@ ClutterFrameTicker.prototype = {
             function(timeline, frame) {
                 this._onNewFrame(frame);
             }));
+
+        let perf_log = Shell.PerfLog.get_default();
+        perf_log.define_event("tweener.framePrepareStart",
+                              "Start of a new animation frame",
+                              "");
+        perf_log.define_event("tweener.framePrepareDone",
+                              "Finished preparing frame",
+                              "");
     },
 
     _onNewFrame : function(frame) {
@@ -233,8 +242,11 @@ ClutterFrameTicker.prototype = {
             this._startTime = this._timeline.get_elapsed_time();
 
         // currentTime is in milliseconds
+        let perf_log = Shell.PerfLog.get_default();
         this._currentTime = (this._timeline.get_elapsed_time() - this._startTime) / slowDownFactor;
+        perf_log.event("tweener.framePrepareStart");
         this.emit('prepare-frame');
+        perf_log.event("tweener.framePrepareDone");
     },
 
     getTime : function() {